#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include "wikiproclib.h"

loc l(float x, float y, float z) {
	loc ret;
	ret.x = x;
	ret.y = y;
	ret.z = z;
	return ret;
}

int main(int argc, char** argv) {

	printf("length... %d %d %d\n", length(l(0, 0, 1)), length(l(0, 1, 0)),
			length(l(1, 0, 0)));
	printf("length... %d\n", length(l(3, 4, 0)));
	printf("length... %d\n", length(l(3, 0, 4)));
	printf("length... %d\n", length(l(4, 0, 3)));
	printf("length (-1,0,0)... %d\n", length(l(-1, 0, 0)));
	printf("distance between (-1,0,0) and (1,0,0)... %d\n",
			distance(l(-1, 0, 0), l(1, 0, 0)));
	printf("distance between (1,0,0) and (-1,0,0)... %d\n",
			distance(l(1, 0, 0), l(-1, 0, 0)));
	printf("distance between (1,0,0) and (0,1,0)... %f\n",
			distance(l(1, 0, 0), l(0, 1, 0)));
	printf("distance between (1,0,0) and (0,1,1)... %f\n",
			distance(l(1, 0, 0), l(0, 1, 1)));
	printf("distance between 0 and 1 \t %d\n",
			distance(l(0, 0, 0), l(0, 0, 1)));

	printf("distance between (0,0,0) and (0,0,1) \t %d\n",
			distance(l(0, 0, 0), l(0, 0, 1)));
	printf("distance between (0,0,0) and (0,1,0) \t %d\n",
			distance(l(0, 0, 0), l(0, 1, 0)));
	printf("distance between (0,0,1) and (0,1,0) \t %d\n",
			distance(l(0, 0, 1), l(0, 1, 0)));

	printf("attraction between (0,0,0) and (0, 1, 0) \t %f\n",
			length(attraction(l(0, 0, 0), l(0, 1, 0))));
	printf("attraction between (0,0,0) and (0, 7, 0) \t %f\n",
			length(attraction(l(0, 0, 0), l(0, 7, 0))));

	return 0;
}
